Public Class MultiEstudiante

    Public Function buscarEstudiantePorCarne(ByVal pcarne As String) As DataTable
        Dim dt As DataTable
        If Trim(pcarne).Length = 0 Then
            Throw New ArgumentException("Debe insertar el Carnet?")
        Else
            dt = New accesoBD.TripleCDataSetTableAdapters.selectEstudiante_CarneTableAdapter().GetData(pcarne)
            If dt.Rows.Count = 0 Then
                Throw New ArgumentException("Este Carnet nunca ha sido registrado")
            End If
        End If
        Return dt
    End Function

    Public Function autenticar(ByVal pcarne As String, ByVal ppas As String) As Boolean
        Dim dt As DataTable
        dt = New accesoBD.TripleCDataSetTableAdapters.autenticarTableAdapter().GetData(pcarne, ppas)
        If dt.Rows.Count > 0 Then
            Return True
        End If
    End Function


    Public Function cargar(ByVal pcarne As String) As ArrayList
        Dim dt As DataTable
        Dim datosG As New ArrayList
        Dim i As Integer
        Dim msj As String
        dt = New accesoBD.TripleCDataSetTableAdapters.CargarGruposTableAdapter().GetData(pcarne)
        If dt.Rows.Count > 0 Then
            For i = 0 To dt.Rows.Count - 1
                Dim datos As New ArrayList
                msj = CType(dt.Rows.Item(i).Item(0), String)
                datos.Add(msj)
                msj = CType(dt.Rows.Item(i).Item(1), String)
                datos.Add(msj)
                msj = CType(dt.Rows.Item(i).Item(2), String) & " - " & CType(dt.Rows.Item(i).Item(3), String)
                datos.Add(msj)
                datosG.Add(datos)
            Next
        End If
        Return datosG
    End Function

End Class
